package com.xinfan.io.reader;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * @Author xin
 * @Date 2022/6/8 19:40
 * @Version 1.0
 */
public class BufferedReader1_ {
    public static void main(String[] args) {
        String src = "G:\\桌面\\test.txt";
        FileReader fileReader = null;
        String line;
        BufferedReader bufferedReader = null;

        try {
            fileReader = new FileReader(src);
            bufferedReader = new BufferedReader(fileReader);
            while ((line = bufferedReader.readLine()) != null) {
                System.out.println(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                bufferedReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }


    }
}
